<?php

namespace app\api\controller;

use \tpfcore\Core;

/**
 * @title   小程序留言接口类
 * @description
 * @group   小程序接口
 * Class ProgramConsult
 * @package app\api\controller
 */
class ProgramConsult extends ApiBase
{
	/**
     * @title       在线咨询提交
     * @description 在线咨询信息保存
     * @author      TPFrame
     * @url         /api/program_consult/save/
     * @method POST
     * @param_send  name:api_version type:string require:1 default:"" other:格式x.x.x desc:版本号
     * @param_send  name:name type:string require:1 default:空字符串"" other:xxx desc:姓名
     * @param_send  name:mobile type:string require:1 default:空字符串"" other:xxx desc:手机号
     * @param_send  name:is_inform type:integer require:1 default:0 other:1-是,0-否 desc:短信通知 整数
     * @param_send  name:career type:integer require:1 default:0 other:专业ID desc:感兴趣专业
     * @param_send  name:content type:string require:1 default:空字符串"" other:xxx desc:留言内容
     */
	public function save(){
		switch ($this->api_version) {
			case '1.0':
				$this->jump(Core::loadModel('CustomForm')->saveCustomForm($this->param));
				break;
			default:
				$this->jump([40048, '版本号错误']);
				break;
		}
	}

     public function save_reg(){
          switch ($this->api_version) {
               case '1.0':
                    $this->jump(Core::loadModel('CustomForm')->saveRegCustomForm($this->param));
                    break;
               default:
                    $this->jump([40048, '版本号错误']);
                    break;
          }
     }

     public function index(){
          switch ($this->api_version) {
               case '1.0':
                    $this->jump(Core::loadModel('CustomForm')->getCustomForm(["where"=>["sign"=>"user_form"]]));
                    break;
               default:
                    $this->jump([40048, '版本号错误']);
                    break;
          }
     }
}